<?php
 

require_once('config/config.php');

// 设置防止异常访问的php文件
// 接受id 和 username 的值

$sql = "SELECT * FROM {$pre_}admin WHERE `id` = '{$_SESSION['id']}' and `username`='{$_SESSION['username']}'";

if(!$_SESSION['id'] || !$_SESSION['username'])
{
    session_destroy();
    notice('异常登录','login.php');
    exit;
}
$res = mysqli_query($connect,$sql);

// $res = select($sql);


$admin = mysqli_fetch_assoc($res);


if(empty($admin))
{
    session_destroy();
    notice('登录信息有误，请重新登录!','login.php');
    exit;
}



?>